import java.util.Scanner;

public class Main {
    Integer k=0;
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String newWord=reverse(str);
        System.out.println(newWord);
    }

    public static String reverse(String word){
        String[] words=word.split(" ");
        String newWord="";
        for(String wd:words){
//            System.out.println(wd);
//            System.out.println(isNumeric(wd));
            if(isNumeric(wd)){
                newWord+=reverseWord(wd)+" ";
            }else{
                newWord+=""+reverseWord(wd);
            }

        }

        return newWord;
    }
    public static boolean isNumeric(String word){
        char[] wordChar=word.toCharArray();
        boolean flag=false;
        for(int i=0;i<wordChar.length;i++){
            if(((int)wordChar[i]>=65&&(int)wordChar[i]<=90)||((int)wordChar[i]>=97&&(int)wordChar[i]<=122)){
                flag=true;
            }else {
                flag=false;
            }
        }
        return flag;
    }
    public static String reverseWord(String word){
        char[] wordChar=word.toCharArray();
        int l=wordChar.length-1;
        for(int i=0;i<l&&i<wordChar.length;i++){
            if(wordChar[i]=='"')
            {
                i++;
            }else if(wordChar[l]=='"')
            {
                l-=1;
            }
            char temp=wordChar[i];
            wordChar[i]=wordChar[l];
            wordChar[l]=temp;
            l--;
        }
        String newSword=new String(wordChar);
        return newSword;
    }

}
